home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir24 / tn-x1jr2.zip / TN-X1J2.ZIP / DEVMETER.TXT < prev    next >
Text File  |  1993-08-12  |  14KB  |  307 lines

  1.                  Deviation Meter For TheNet X-1J
  2. 1. INTRODUCTION
  3.             
  4.      The deviation meter is actually a peak audio level meter. It 
  5.      is  the first of a series of applications built into  TheNet 
  6.      X-series  firmware that makes use of an Analogue to  Digital 
  7.      Converter  ( ADC ). The ADC can be (optionally) added  quite 
  8.      simply to a TNC2.
  9.  
  10.      This paper describes the circuit, its configuration and  its 
  11.      operation.
  12.             
  13. 2. CIRCUIT OVERVIEW
  14.  
  15.      The basic structure of the circuit is shown below :
  16.  
  17.      << **************************************************** >>
  18.      << diagrams are only in MS-word version of the document >> 
  19.      << **************************************************** >>
  20.      
  21.      The  audio  input is amplified and converted to  a  DC  peak 
  22.      representation. This voltage is read by the ADC, which has a 
  23.      range  of 0 .. 3 volts, and converted into an 8  bit  binary 
  24.      value in the range 0 .. 255.
  25.  
  26.      The  software  is configured to read the ADC at the  end  of 
  27.      each  valid packet. A packet is considered valid if its  CRC 
  28.      is  correct. As soon as a valid CRC is detected, the ADC  is 
  29.      instructed  to  start  converting  on  the  deviation  meter 
  30.      channel, this conversion taking 30 microseconds. Just before 
  31.      the  formatted  frame is linked into the  chain  of  pending 
  32.      received  frames, the ADC is read and the value stored  with 
  33.      the frame.
  34.  
  35.      The reading therefore corresponds to the peak audio level at 
  36.      the  end  of a packet. If there are no non  linear  elements 
  37.      between  the receiver's discriminator and the  meter  input, 
  38.      this   will  correspond  fairly  accurately  to   the   peak 
  39.      deviation.
  40.  
  41.      Care  must  be taken over its interpretation.  It  does  not 
  42.      measure  independently the two tone levels - it  is  assumed 
  43.      that whatever local standards that relate to pre-emphasis  ( 
  44.      i.e. use it or not ) have been implemented. If used for 9600 
  45.      baud FSK operation, this is not a problem.
  46.  
  47.      The  meter  will  give the wrong  answer  on  the  following 
  48.      conditions 
  49.  
  50.             A badly distorted audio signal
  51.             Badly off frequency
  52.             Incorrect adherence to local pre-emphasis 
  53.                    standards if used for AFSK
  54.             A noisy signal
  55.             
  56. 3. SOFTWARE
  57.  
  58.  
  59.      As explained in section 2, the deviation meter is  activated 
  60.      on  receipt  of  a  valid  packet.  The  software  interrupt 
  61.      routine,  upon detecting a valid CRC, whether the  deviation 
  62.      meter  is  installed or not, whether it is enabled  or  not, 
  63.      will instantly write the 'start channel conversion'  command 
  64.      to the ADC ( I/O address 0x20 ) as soon as the interrupt  is 
  65.      serviced.  It  will therefore also be signalled  when  other 
  66.      errors such as framing or invalid CRCs are detected.
  67.  
  68.      If  the  CRC is correct, then about 50 to  100  microseconds 
  69.      later,  the  Z80  will  read the  ADC  and  will  store  the 
  70.      corresponding  value  with the packet. Again,  this  happens 
  71.      whether or not the function is enabled (it is quicker to  do 
  72.      it than to test whether to do it or not ! ).
  73.  
  74.      The value received is transferred to the internal heard list 
  75.      format  without conversion. It is still therefore the 8  bit 
  76.      count ( 0 to 255 ).
  77.      
  78.      When  a  user displays the heard list, the  deviation  meter 
  79.      parameter  (  as  set with the METER command )  is  used  to 
  80.      control  the display. If it is zero, the  deviation  details 
  81.      are not displayed in the heard list. If it is non zero, then 
  82.      the  8 bit count value is multiplied by the METER  value  to 
  83.      give  a  deviation reading in hertz. This  is  displayed  as 
  84.      kilohertz in the heard list. If the METER setting is '1'  it 
  85.      will have a full scale range of 0.2 KHz ( not very useful ). 
  86.      If set to 10, it will have a full scale range of 2.5 KHz. If 
  87.      set to 255, it will display up to 64 KHz. A typical  setting 
  88.      will  therefore be in the range 15 to 30, depending  on  the 
  89.      analogue  setting. The objective is to set it such that  the 
  90.      maximum  possible audio level from the receiver,  given  its 
  91.      filters, corresponds to just under the 3 volt maximum  input 
  92.      to the ADC.
  93.  
  94.      The deviation is displayed to a resolution of 100 Hz, but it 
  95.      should not be assumed to be this accurate.
  96.  
  97.      Small fluctuations in the reading can be expected.
  98.  
  99.      Finally,  to  guard  against  an  unnoticed  overrange,  the 
  100.      display in the heard list will precede the deviation reading 
  101.      by  a chevron ( '>' ) if the value read from the ADC is  254 
  102.      or 255.
  103.             
  104. 4. Detailed Circuit Description.
  105.  
  106.      All  of the signals necessary for this circuit are found  on 
  107.      the  Z80 CPU chip located on the TNC motherboard,  with  the 
  108.      exception of a -5V power supply, and the audio signal to  be 
  109.      measured.
  110.  
  111.      We therefore decided to base the circuit around the Z80 CPU. 
  112.      We knew from experience that people are reluctant to  attack 
  113.      the  insides of their TNCs' with a hot soldering  iron,  and 
  114.      settled  on  the socket idea as the least intrusive  way  of 
  115.      gaining access to the required signals.
  116.  
  117.      The  circuit  was designed with the radio ham  junk  box  in 
  118.      mind,  with the only "specialist part"  required  being  the 
  119.      ADC itself. 
  120.  
  121.      The input is first amplified (x10) by U2A a quarter part  of 
  122.      the  LM324  quad op-amp. This circuit is  also  a  precision 
  123.      half-wave  rectifier, which is used to reduce the effect  of 
  124.      D1's voltage offset. A more linear response is obtained with 
  125.      this  configuration. The output is smoothed by C2, and  then 
  126.      R3   provides   a  user  adjustable  control  for   the   DC 
  127.      representation of the received audio level into the ADC.
  128.  
  129.      The  second  part of the quad op-amp (U2B)  provides  a  low 
  130.      impedance voltage reference drive for the ADC. R6 should  be 
  131.      adjusted  such that the DC level on pin 8 (VREF) on the  ADC 
  132.      is equal to 3.0 V.
  133.  
  134.      The  address decode for the ADC is performed by 2  parts  of 
  135.      the  74HC00 (U3). The ADC is mapped to the I/O address  0x20 
  136.      and is selected by the X-1J software when required.
  137.      
  138.      The   other  three  (customisable)  ADC  channels  will   be 
  139.      available  for  use  in later releases, for  such  items  as 
  140.      temperature sensors, pressure sensors, or whatever comes  to 
  141.      mind  that will be of interest to users etc. There are  also 
  142.      two  spare  op-amps  within the LM324  for  use  with  these 
  143.      'customisable   inputs'.   Any  input   signal   should   be 
  144.      conditioned to provide a 0V...3V full scale signal into  the 
  145.      ADC .
  146.  
  147. 4.1 Parts List
  148.             
  149.             
  150.      QTY       REF                 PART
  151.      
  152.      2              C1, C3         1 fF @ 10V
  153.      1              C4             0.1 fF (de coupling capacitor)
  154.      1              C2             22 fF @ 10V
  155.      1              R1             10K
  156.      2              R5,R7          1K
  157.      1              R4             1K8
  158.      2              R3,R6          10K Miniature Potentiometers
  159.      1              R2             100K
  160.      2              D1,D3          IN4148
  161.      1              D2             2V7 Zener (250mW)
  162.      1              U1             ADC0844 (National Semi.) *
  163.      1              U2             LM324
  164.      1              U3             74HC00
  165.      1              JP1            3 pin HEADER
  166.      1              40PIN          40PIN WIRE WRAP SOCKET
  167.      1              PCB
  168.      1              X-1J           SOFTWARE!
  169.  
  170.      *  The  ADC0844 is a four channel ADC  available  from  most 
  171.      large  mail-order companies. At the time of the X1J  release 
  172.      (August '93), I have had some concern over the price of  the 
  173.      device.  When originally selected the device  was  available 
  174.      for  approx.  8 in the UK. In the last two  months  it  has 
  175.      risen to 18!  It may be cheaper direct from outlets  within 
  176.      the USA.
  177.  
  178. 5. Construction
  179.             
  180.      PCB's,  PCB  patterns,  and  component  locations  will   be 
  181.      available  from G0JVU / G8KBB starting in  September,  1993. 
  182.      The  PCB  will be single sided and approx. 3 inches by  2  + 
  183.      inches.
  184.  
  185.      However  the  circuit  is  not  complex  and  for  the  more 
  186.      adventurous  a  small circuit can be built up  (without  the 
  187.      need for a 40 pin socket) and then wired to the solder  side 
  188.      of the TNC motherboard. In fact the original prototype built 
  189.      on veroboard measured 1 inch by 2+ inches. 
  190.  
  191.      The  40 pin socket on the DEV PCB is intended to be  a  wire 
  192.      wrap  type,  soldered  to the DEV unit PCB  with  long  legs 
  193.      extending  down,  cropped so that the PCB can  be  "plugged" 
  194.      into  the  40  pin Z80 socket on the  TNC  motherboard.  The 
  195.      previously removed Z80 CPU is then re-inserted in the socket 
  196.      on the DEV PCB.
  197.  
  198.      If your TNC's Z80 is not socketed, you may like to  consider 
  199.      adding  one  now! Otherwise you will need to work  out  some 
  200.      other way of getting the necessary signals to the DEV board. 
  201.      I  suggest fitting a  "tin-plate" folded pin socket, as  the 
  202.      wire wrap sockets will locate into them. Turned pin  sockets 
  203.      present extreme difficulty in mating with the square section 
  204.      wire wrap sockets.
  205.      
  206.      If   there  is not enough clearance in the TNC box  for  the 
  207.      extra PCB, you could consider using a header plug, with  the 
  208.      necessary  signals  being  transferred to the  DEV  board  , 
  209.      mounted elsewhere, via a short cable.
  210.      
  211.      There are three other connections that need to be made  from 
  212.      the DEV PCB to the TNC motherboard:
  213.      
  214.      JP1 Pin 1      Cable shield for audio signal (Earth)
  215.      JP1 Pin 2      Audio input from rig (5pin DIN inside TNC)
  216.      JP1 Pin 3      -5V (from TNC motherboard)
  217.      
  218.      
  219.      Solder  in the components in the usual way, taking care  not 
  220.      to make any solder bridges to the tracks running  in-between 
  221.      the IC pads. Ensure the chips, and polarised components  are 
  222.      the  right way around, and take the usual  ESD  precautions. 
  223.      There are four wire links needed on the PCB to complete  the 
  224.      single-sided circuit.
  225.      
  226. 6. Alignment
  227.             
  228.      There are four adjustable controls that will need to be set-
  229.      up for correct operation.
  230.      
  231.      1) Radio's   audio  drive  signal  into  the  TNC.   (Volume 
  232.         control).
  233.      2) The deviation signal level control (R3).
  234.      3) The reference voltage for the ADC. (R6)
  235.      4) The METER parameter within X-1J.
  236.      
  237.      The best set-up sequence (todate)  is:-
  238.  
  239.      a) Adjust R6 on the DEV board to give 3.0V input into pin  8 
  240.         of the ADC.
  241.      b) Attach  an  oscilloscope (if available) to pin 1  of  the 
  242.         LM324.  Turn  the  rig's squelch control  such  that  the 
  243.         squelch  noise is driving the input of the  DEV  circuit. 
  244.         Adjust the rig's audio drive signal into the DEV  circuit 
  245.         so  that  the output of the op-amp is just  clipping  the 
  246.         power  rails.  This will be seen as a 10V  peak  to  peak 
  247.         signal.  
  248.      c) Adjust R3 to give the maximum DC signal into pin 3 of the 
  249.         ADC. This should be 3V maximum.
  250.  
  251.      Note: The function of R3 is to scale the input voltage  into 
  252.      the  ADC. The maximum signal available from the  circuit  is 
  253.      approx. 3V which corresponds to the full range of the ADC. A 
  254.      3V input into the ADC will enable the circuit to present the 
  255.      widest  possible  range  of values  to  the  X-1J  software.  
  256.      However significant "unexplained" variations in the reported 
  257.      deviation (MHEARD list) can be reduced by lowering the input 
  258.      voltage  to the ADC. If you do need to adjust this  voltage, 
  259.      then you will also have to adjust the METER parameter within 
  260.      the X-1J software again.
  261.      
  262.      d) The  "METER"  parameter  within  X-1J  gives  the   final 
  263.         adjustment to the circuit. Converting the received binary 
  264.         number into a meaningful deviation in KHz.
  265.         In practice with the unit operating as described above, a 
  266.         value of 47 was found to provide a true representation of 
  267.         the  displayed  deviation to the measured  deviation.  To 
  268.         ensure an accurate measurement is given to the user,  you 
  269.         will need to calibrate the function using a signal with a 
  270.         known deviation!
  271.      
  272.      As  you  can  see from the above set up  procedure.  If  you 
  273.      change the setting of the volume on the rig afterwards,  all 
  274.      will  be  lost!   It is preferable to take  the  audio  from 
  275.      before  the  audio  amplifier sections  of  the  receiver  ( 
  276.      ideally  direct from the discriminator ) and to  adjust  the 
  277.      parameters or op-amp gain accordingly.
  278.  
  279. 7. Contacts.
  280.  
  281.      G8KBB can be contacted via...
  282.  
  283.      G8KBB @ GB7MXM
  284.      +44 473 682266 ( GMT 19:00 - 2200)
  285.  
  286.      Dave Roberts
  287.      7, Rowanhayes Close
  288.      Ipswich
  289.      IP2 9SX
  290.      ENGLAND
  291.  
  292.      G0JVU can be contacted via....
  293.  
  294.      G0JVU @ GB7MXM
  295.      G0JVU @ G0JVU.ampr.org
  296.      NEVILLE @ SWFMC1.SINET.SLB.COM
  297.      Compuserve: 100021,3307
  298.      +44 394 274795 (GMT 19:00 - 22:00)
  299.  
  300.      Neville Pattinson
  301.      10, High Hall Close
  302.      Trimley St Martin
  303.      Felixstowe
  304.      Suffolk
  305.      IP10 0TJ
  306.  
  307.